import numpy as np
import matplotlib.pyplot as plt

def plot_trajectory(trajectory, title='Drone Trajectory'):
    """
    Plots the trajectory of a drone in 3D space.

    Parameters:
    - trajectory: A numpy array of shape (N, 3) where N is the number of points in the trajectory.
    - title: Title of the plot.
    """
    if trajectory.shape[1] != 3:
        raise ValueError("Trajectory must be a Nx3 array representing x, y, z coordinates.")

    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    ax.plot(trajectory[:, 0], trajectory[:, 1], trajectory[:, 2], marker='.', markersize=0.1 , linestyle='none', color='r')
    ax.set_xlabel('X Position (m)')
    ax.set_ylabel('Y Position (m)')
    ax.set_zlabel('Z Position (m)')
    ax.set_title(title)
    
    plt.show()